package com.awesome.videodemo.video.natives;

import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.awesome.common.base.mvp.BaseActivity;
import com.awesome.common.constant.Constant;
import com.awesome.videodemo.R;
import com.awesome.videodemo.video.natives.widget.CustomVideoView;

public class CustomVideoViewActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_custom_video_view);
        if (!hasPermission(Constant.WRITE_EXTERNAL_PERMISSION)) {
            requestPermission(Constant.WRITE_EXTERNAL_CODE, Constant.WRITE_EXTERNAL_PERMISSION);
        }
        LinearLayout linearLayout = findViewById(R.id.ll_container);
        CustomVideoView customVideoView = new CustomVideoView(this, linearLayout);
        customVideoView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
        customVideoView.setDataSource("/storage/emulated/0/DCIM/Camera/VID_20220323_112329.mp4");
        customVideoView.isPlaying();
    }
}